package com.itheima_11;

import java.util.Comparator;
import java.util.TreeSet;

public class test_11_5 {
    public static void main(String[] args) {
        TreeSet<Double> r=new TreeSet<>(new Comparator<Double>() {
            @Override
            public int compare(Double o1, Double o2) {
                int reuslt = o1.compareTo(o2);
                if(reuslt==0){
                   reuslt=1;
                }
                return reuslt;
            }
        });
        r.add(1.1);
        r.add(5.2);
        r.add(6.3);
        r.add(2.5);
        r.add(5.2);
        r.add(3.3);
        for (Double aDouble : r) {
            System.out.println(aDouble);
        }
    }
}
